package com.liming.user.controller;

import com.liming.common.result.LMResult;
import com.liming.service.wx.pojo.vo.PrepayVO;
import com.liming.user.service.PaymentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liming
 * @date 2025/4/9
 */
@Slf4j
@RestController
@AllArgsConstructor
@Tag(name = "支付接口-Web")
@RequestMapping("/user/payment")
public class PaymentController {

    private final PaymentService paymentService;

    @Operation(summary = "用户对订单发起二次支付")
    @GetMapping("wx_repay/{orderId}")
    public LMResult<PrepayVO> rePayment(@PathVariable Long orderId) {
        return LMResult.success(paymentService.wxRepay(orderId));
    }
}
